package user.client;

import com.example.entity.Carrier;
import com.example.entity.Truck;
import com.example.entity.User;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;


@Component   //注意，需要将其注册为Bean，Feign才能自动注入
public class CarrierFallbackClient implements CarrierClient{
    @Override // 根据id获取货车
    public void insert( Carrier c) {
        System.out.println("服务降级");
    }
    @Override // 根据用户id获取承运商
    public Carrier selectCarrierByUser( Long id) {
        System.out.println("服务降级");
        Carrier c = new Carrier();
        c.setName("我是代替方案");
        return c;
    }
}
